package jmine.tec.hydra.mock;

import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;

import javax.jms.BytesMessage;
import javax.jms.Destination;
import javax.jms.JMSException;

/**
 * Implementação mock de um BytesMessage que utiliza um inputstream para gerar os dados para o MDB.
 * 
 * @author piercio
 */
public class MockBytesMessage implements BytesMessage {

    private final InputStream message;

    public MockBytesMessage(InputStream message) {
        this.message = message;
    }

    public String getJMSMessageID() throws JMSException {
        return "TEST_MESSAGE_1";
    }

    public int readBytes(byte[] b) throws JMSException {
        try {
            return this.message.read(b);
        } catch (IOException e) {
            throw new JMSException("Not available.");
        }
    }

    // Não é usado.

    public boolean readBoolean() throws JMSException {
        return false;
    }

    public byte readByte() throws JMSException {
        return 0;
    }

    public int readBytes(byte[] arg0, int arg1) throws JMSException {
        return 0;
    }

    public char readChar() throws JMSException {
        return 0;
    }

    public double readDouble() throws JMSException {
        return 0;
    }

    public float readFloat() throws JMSException {
        return 0;
    }

    public int readInt() throws JMSException {
        return 0;
    }

    public long readLong() throws JMSException {
        return 0;
    }

    public short readShort() throws JMSException {
        return 0;
    }

    public String readUTF() throws JMSException {
        return null;
    }

    public int readUnsignedByte() throws JMSException {
        return 0;
    }

    public int readUnsignedShort() throws JMSException {
        return 0;
    }

    public void reset() throws JMSException {

    }

    public void writeBoolean(boolean arg0) throws JMSException {

    }

    public void writeByte(byte arg0) throws JMSException {

    }

    public void writeBytes(byte[] arg0) throws JMSException {

    }

    public void writeBytes(byte[] arg0, int arg1, int arg2) throws JMSException {

    }

    public void writeChar(char arg0) throws JMSException {

    }

    public void writeDouble(double arg0) throws JMSException {

    }

    public void writeFloat(float arg0) throws JMSException {

    }

    public void writeInt(int arg0) throws JMSException {

    }

    public void writeLong(long arg0) throws JMSException {

    }

    public void writeObject(Object arg0) throws JMSException {

    }

    public void writeShort(short arg0) throws JMSException {

    }

    public void writeUTF(String arg0) throws JMSException {

    }

    public void acknowledge() throws JMSException {

    }

    public void clearBody() throws JMSException {

    }

    public void clearProperties() throws JMSException {

    }

    public boolean getBooleanProperty(String arg0) throws JMSException {
        return false;
    }

    public byte getByteProperty(String arg0) throws JMSException {
        return 0;
    }

    public double getDoubleProperty(String arg0) throws JMSException {
        return 0;
    }

    public float getFloatProperty(String arg0) throws JMSException {
        return 0;
    }

    public int getIntProperty(String arg0) throws JMSException {
        return 0;
    }

    public String getJMSCorrelationID() throws JMSException {
        return null;
    }

    public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
        return null;
    }

    public int getJMSDeliveryMode() throws JMSException {
        return 0;
    }

    public Destination getJMSDestination() throws JMSException {
        return null;
    }

    public long getJMSExpiration() throws JMSException {
        return 0;
    }

    public int getJMSPriority() throws JMSException {

        return 0;
    }

    public boolean getJMSRedelivered() throws JMSException {

        return false;
    }

    public Destination getJMSReplyTo() throws JMSException {
        return null;
    }

    public long getJMSTimestamp() throws JMSException {
        return 0;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#getJMSType()
     */
    public String getJMSType() throws JMSException {
        return null;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#getLongProperty(java.lang.String)
     */
    public long getLongProperty(String arg0) throws JMSException {
        return 0;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#getObjectProperty(java.lang.String)
     */
    public Object getObjectProperty(String arg0) throws JMSException {
        return null;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#getPropertyNames()
     */
    public Enumeration getPropertyNames() throws JMSException {

        return null;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#getShortProperty(java.lang.String)
     */
    public short getShortProperty(String arg0) throws JMSException {

        return 0;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#getStringProperty(java.lang.String)
     */
    public String getStringProperty(String arg0) throws JMSException {

        return null;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#propertyExists(java.lang.String)
     */
    public boolean propertyExists(String arg0) throws JMSException {

        return false;
    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setBooleanProperty(java.lang.String, boolean)
     */
    public void setBooleanProperty(String arg0, boolean arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setByteProperty(java.lang.String, byte)
     */
    public void setByteProperty(String arg0, byte arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setDoubleProperty(java.lang.String, double)
     */
    public void setDoubleProperty(String arg0, double arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setFloatProperty(java.lang.String, float)
     */
    public void setFloatProperty(String arg0, float arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setIntProperty(java.lang.String, int)
     */
    public void setIntProperty(String arg0, int arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSCorrelationID(java.lang.String)
     */
    public void setJMSCorrelationID(String arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSCorrelationIDAsBytes(byte[])
     */
    public void setJMSCorrelationIDAsBytes(byte[] arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSDeliveryMode(int)
     */
    public void setJMSDeliveryMode(int arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSDestination(javax.jms.Destination)
     */
    public void setJMSDestination(Destination arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSExpiration(long)
     */
    public void setJMSExpiration(long arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSMessageID(java.lang.String)
     */
    public void setJMSMessageID(String arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSPriority(int)
     */
    public void setJMSPriority(int arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSRedelivered(boolean)
     */
    public void setJMSRedelivered(boolean arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSReplyTo(javax.jms.Destination)
     */
    public void setJMSReplyTo(Destination arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSTimestamp(long)
     */
    public void setJMSTimestamp(long arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setJMSType(java.lang.String)
     */
    public void setJMSType(String arg0) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setLongProperty(java.lang.String, long)
     */
    public void setLongProperty(String arg0, long arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setObjectProperty(java.lang.String, java.lang.Object)
     */
    public void setObjectProperty(String arg0, Object arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setShortProperty(java.lang.String, short)
     */
    public void setShortProperty(String arg0, short arg1) throws JMSException {

    }

    /*
     * (non-Javadoc)
     * @see javax.jms.Message#setStringProperty(java.lang.String, java.lang.String)
     */
    public void setStringProperty(String arg0, String arg1) throws JMSException {

    }

    public long getBodyLength() throws JMSException {
        return 0;
    }

}
